/******************************************************************************
 * SAGE - Scalable Adaptive Graphics Environment
 *
 * Module: sageDrawObject.h
 * Author : Byungil Jeong
 *
 *	Description: the super class of simple drawing objects 
 *
 * Copyright (C) 2007 Electronic Visualization Laboratory,
 * University of Illinois at Chicago
 *
 * This library is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either Version 2.1 of the License, or
 * (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Lesser Public License along
 * with this library; if not, write to the Free Software Foundation, Inc.,
 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * Direct questions, comments etc about SAGE to bijeong@evl.uic.edu or 
 * http://www.evl.uic.edu/cavern/forum/
 *			
*********************************************************************************/

#ifndef SAGE_DRAW_OBJECT_H
#define SAGE_DRAW_OBJECT_H

#include "sageBase.h"

#if defined(__APPLE__)
#include <OpenGL/gl.h>	// Header File For The OpenGL Library
#include <OpenGL/glu.h>	// Header File For The GLu Library
#include <OpenGL/OpenGL.h>

#else
#include <GL/gl.h>	// Header File For The OpenGL Library
#include <GL/glu.h>	// Header File For The GLu Library
#endif

class sageDrawObject : public sageRect {
protected:
	char objName[SAGE_NAME_LEN];
	int objectID;
	bool global;
	sageRect tileRect;

	int setGlobalView();
	int setLocalView();
		
public:
	sageDrawObject() : objectID(0), global(true) {}
	void setName(char *name);
	char *getName() { return objName; }
	int getID() { return objectID; }
	void init(int id, char *name, sageRect &layout, bool g);	
	void updatePosition(int nx, int ny) { x = nx; y = ny; }
	int setViewport(sageRect &rect);	
	
	virtual int init(char *name) = 0;	
	virtual int draw() = 0;	
	virtual int destroy() = 0;
	virtual int parseMessage(char *msg) = 0;
};

#endif
